package com.yonyou.crm.sprc.oppstage.rmimpl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yonyou.crm.sprc.oppstage.entity.OppstageVO;
import com.yonyou.crm.sprc.oppstage.rmitf.IOppstageRmService;
import com.yonyou.crm.sprc.oppstage.service.OppstageBizServiceImpl;

@Service("oppstageService")
public class OppstageRmServiceImpl implements IOppstageRmService {

	@Autowired
	private OppstageBizServiceImpl service;

	@Override
	public List<OppstageVO> list(Map<String, Object> paraMap) {
		return service.getOppstageList(paraMap);
	}

	@Override
	public OppstageVO detail(Long id) {
		return service.getVOById(OppstageVO.class, id);
	}

	@Override
	public OppstageVO insert(OppstageVO vo) {
		return service.saveVO(vo);
	}

	@Override
	public OppstageVO update(OppstageVO vo) {
		service.updateVO(vo);
		return service.getDetail(vo.getId());
	}

	@Override
	public List<OppstageVO> batchDelete(String[] ids,
										Map<String, Object> paraMap) {
		service.batchDeleteByIDs(OppstageVO.class, ids);
		return service.getOppstageList(paraMap);
	}


	public List<OppstageVO> batchUpdateEnableState(String[] ids,
												   Integer enableState, Map<String, Object> paraMap) {
		service.batchUpdateEnableState(ids, enableState);
		return service.getOppstageList(paraMap);
	}

	@Override
	public List<OppstageVO> getStageByBiztype(String biztype){
		return service.getStageByBiztype(biztype);
	}
	
	@Override
	public List<OppstageVO> getStageByTenant(){
		return service.getStageByTenant();
	}
}
